<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:a4j="http://richfaces.org/a4j">           


<ui:composition template="/resources/jsf/component/include/default.xhtml">
    
    <ui:define name="head">
        <ui:include src="/resources/jsf/component/composition/system/css/default.xhtml" />
    </ui:define>
    
    <ui:define name="left-content">
        <ui:include src="/resources/jsf/component/composition/user/profile/view-profile-user.xhtml" />
    </ui:define>

    <ui:define name="content">
        <h2>Atualizações</h2>
        <h:form>
            
            <h:commandLink action="#{feedc.previous}" value="anteriores " >
                <f:ajax execute="@form" render="@form" />
            </h:commandLink>
            
            <h:commandLink action="#{feedc.next}" value=" próximos">
                <f:ajax execute="@form" render="@form" />
            </h:commandLink>
                        
            <a4j:status>
                <f:facet name="start">
                    <h:graphicImage name="loader.gif" library="image" />
                </f:facet>
            </a4j:status>
            
            
            <h:dataTable id="products" value="#{feedc.feedb.products}" var="p">
                <h:column>
                    <h:graphicImage value="#{p.operation.operation == 'troca' ? '/resources/image/operation/exchange_16.jpg': '/resources/image/operation/donation_16.jpg'}" />
                    <h:outputText value=" #{p.user.person.name} #{p.user.person.surname} : " />
                    
                        <h:commandLink action="#{searchc.view(p)}">
                            <h:outputText value="#{p.name}" />
                        </h:commandLink> 
                </h:column>
            </h:dataTable>
            <br/>            
            
        </h:form>
    </ui:define> 
        
    <ui:define name="right-content" >
        <ui:include src="/resources/jsf/component/composition/system/twitter-widget.xhtml" />
    </ui:define>

</ui:composition>
</html>